package dao;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import model.DepartVO;
import model.ProfessorVO;
import model.StudentVO;

public class CheckNo {
	public static boolean profNo(String prof_no, ProfessorVO pv) {
		Pattern p = Pattern.compile("[1][0-9][0-9][0-9]");
		Matcher m = p.matcher(pv.getProf_no());
		boolean a = !m.matches();
		return a; 
	}

	public static boolean stdNo(String std_no, StudentVO sv) {
		Pattern p = Pattern.compile("[1][0|1|2|3][1][1-5][0-9][0-9][0-9][0-9]");
		Matcher m = p.matcher(sv.getStd_no());
		boolean a = !m.matches();
		return a;
	}

	public static boolean deptNo(String depart_no, StudentVO sv) {
		Pattern p = Pattern.compile("[1][0-9]");
		Matcher m = p.matcher(sv.getDept_no());
		boolean a = !m.matches();
		return a;
	}

	public static boolean DeptNo2(String dept_no, DepartVO dv) {
		Pattern p = Pattern.compile("[1][0-9]");
		Matcher m = p.matcher(dv.getDept_no());
		boolean a = !m.matches();
		return a;
	}
}